﻿using Api.Attributes;
using NPOI.SS.Formula.Functions;

namespace Api.Controllers
{
    /// <summary>
    /// DataV
    /// </summary>
    [NotResponseBody]
    public class DataVController : AuthBaseController
    {

        private readonly IDataVLogic _logic;

        public DataVController(IDataVLogic logic)
        {
            _logic = logic;
        }

        //获取钢丝绳综合状态
        [HttpGet]
        public async Task<object> GetSummaryStatusVal(int type)
        {
            return await Task.Run(() => _logic.GetSummaryStatusVal(Gx.GetEnumByValue<StatusMonitor_LightType>(type)));
        }

        //获取钢丝绳综合状态饼图
        [HttpGet]
        public async Task<object> GetSummaryPie()
        {
            return await Task.Run(() => _logic.GetSummaryPie());
        }

        //获取矿山数量
        [HttpGet]
        public async Task<object> GetDepartmentCnt()
        {
            return await Task.Run(() => _logic.GetDepartmentCnt());
        }

        //获取钢丝绳数量
        [HttpGet]
        public async Task<object> GetWireropeCnt()
        {
            return await Task.Run(() => _logic.GetWireropeCnt());
        }

        //获取排名名次及名称
        [HttpGet]
        public async Task<object> GetSortName(int sort)
        {
            return await Task.Run(() => _logic.GetSortName(sort));
        }

        //获取健康程度比例
        [HttpGet]
        public async Task<object> GetHealthBili(int sort)
        {
            return await Task.Run(() => _logic.GetHealthBili(sort));
        }

        //获取地图矿山点数据
        [HttpGet]
        public async Task<object> GetDepartmentPoint()
        {
            return await Task.Run(() => _logic.GetDepartmentPoint());
        }

        //获取区域占比情况
        [HttpGet]
        public async Task<object> GetProvinceCnt()
        {
            return await Task.Run(() => _logic.GetProvinceCnt());
        }

        //获取各矿山钢丝绳总量
        [HttpGet]
        public async Task<object> GetAllDepartmentCnt()
        {
            return await Task.Run(() => _logic.GetAllDepartmentCnt());
        }

        //获取各指标下各状态钢丝绳数量（单个）
        [HttpGet]
        public async Task<object> GetStatusNameValue(string status)
        {
            return await Task.Run(() => _logic.GetStatusNameValue(status));
        }

        //获取各指标项备注信息
        [HttpGet]
        public async Task<object> GetStatusRemark(string status)
        {
            return await Task.Run(() => _logic.GetStatusRemark(status));
        }

        //获取各指标项个状态钢丝绳数量分布
        [HttpGet]
        public async Task<object> GetStatusPie(string status)
        {
            return await Task.Run(() => _logic.GetStatusPie(status));
        }
    }
}
